package com.molichuxing.services.infrastructure.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.StoreDeviceBean;
import com.molichuxing.services.infrastructure.dto.response.StoreDeviceDto;

/**
 * <p>
 * 门店安装的设备表 Mapper 接口
 * </p>
 *
 * @author zph
 * @since 2019-08-12
 */
public interface StoreDeviceMapper extends RootMapper<StoreDeviceBean> {

    /**
     * 批量添加门店设备
     *
     * @param storeDeviceBeanList
     * @return
     */
    int createStoreDeviceBatch(List<StoreDeviceDto> storeDeviceBeanList);


    /**
     * 通过门店id获取设备id
     *
     * @param storeId
     * @return
     */
    List<Integer> getListByStoreId(Integer storeId);


    /**
     * 批量删除
     *
     * @param storeId
     * @param ids
     * @return
     */
    int deleteBatchIds(@Param("storeId") Integer storeId, @Param("ids") List<Integer> ids);

    /**
     * 根据门店删除
     *
     * @param storeId
     * @return
     */
    int deleteByStoreId(Integer storeId);

    /**
     * 查询设备是否和其它门店绑定
     *
     * @param storeId
     * @param deviceIdList
     * @return
     */
    List<Integer> getCountByIds(@Param("storeId") Integer storeId, @Param("deviceIdList") List<Integer> deviceIdList);

    /**
     * 根据设备获取门店id
     *
     * @param deviceId 设备id
     * @return
     */
    List<Integer> getListByDevice(@Param("deviceId") Integer deviceId);

    /**
     * 门店id
     *
     * @param deviceIdList
     * @return
     */
    List<StoreDeviceBean> getStoreIdsByDevice(@Param("deviceIdList") List<Integer> deviceIdList);

    /**
     * 修改
     *
     * @param StoreDeviceBean
     * @return
     */
    int modifyStoreDevice(StoreDeviceBean StoreDeviceBean);

    /**
     * 设备id
     *
     * @param storeIdList
     * @return
     */
    List<Integer> getDeviceIdByStoreIds(@Param("storeIdList") List<Integer> storeIdList);


}
